package com.lishanyang.structs.action;

import com.lishanyang.structs.unity.User;
import com.opensymphony.xwork2.ActionContext;

public class ActionSupport extends com.opensymphony.xwork2.ActionSupport {
    private String username;
    private String password;
    private User user;
    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }



    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    @Override
    public String execute() throws Exception{
        ActionContext ac=ActionContext.getContext();
        if(username.equals("admin") && password.equals("123")){
            ac.put("success","登入成功");
            return SUCCESS;
        }else {
            ac.put("error","用户名或密码错误");
            return ERROR;
        }
    }
}
